<?
	$image = new Image();

	if($file = upload("image")){
		$_POST["image"] = $file[0];
	}

    $db->update("gallery", $_POST, "gid=$gid");

    redirect("index.php");
?>